package com.fs.vo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * @author yyds
 * @fileName Search
 * @date 2024/9/13 10:18
 * @description
 **/
@Data
public class Search {
    private String title;
    private Integer sid;
    private Integer did;
    private List<Integer> tid;
    private String shi;
    private String ting;
    private Integer page;
    private Integer count;
    private Double min;
    private Double max;
    private Integer time;

    public String getShi() {
        return shi + "室";
    }

    public String getTing() {
        return ting + "厅";
    }

    public Date getTime() {
        if (this.time == 0) {
            return null;
        } else {
            long date = System.currentTimeMillis();
            date -= (long)this.time * 24 * 60 * 60 * 1000;
            return new Date(date);
        }
    }

    public List<Integer> getTid() {
        if (tid == null) {
            return new ArrayList<>();
        }
        return tid;
    }
}
